import Vue from 'vue';
import VueRouter from 'vue-router';
import Login from '../views/Login';
import Register from '../views/Register';
import Dashboard from '../views/Dashboard';

Vue.use(VueRouter);

// 普通路由
export const constantRoutes = [
  {
    path: '/login',
    component: Login,
  },
  {
    path: '/register',
    component: Register,
  },
];

// 带权限的路由
export const asyncRoutes = [
  {
    path: '/dashboard',
    component: Dashboard
  }
]

const router = new VueRouter({
  routes: constantRoutes,
  mode: 'history'
});

export default router;
